<template>
    <!-- 订单抽屉 -->
    <div class="drawer">
        <el-drawer destroyOnClose :visible.sync="fillData.isShow_drawer" size="500px" :modal="false"
            :wrapperClosable="false" :close-on-press-escape="false">
            <div slot="title">
                <div class="drawer_order_title" v-show="fill_order_title_show == 1">
                    <div :class="{ 'selectTitle': select_room == 0 }" @click="change_select_room">全日房</div>
                    <div :class="{ 'selectTitle': select_room == 1 }" @click="change_select_room">钟点房</div>
                </div>
                <div v-show="fill_order_title_show == 2" class="titleSlot" style="padding-bottom: 10px;">
                    <div class="titleIcon" @click="back">
                        <i class="el-icon-back"></i>返回
                    </div>
                    <span>{{ fill_order_title }}</span>
                </div>
            </div>

            <div class="drawer_order_content">
                <!-- 基本信息 -->
                <div class="drawer_order_content_box">
                    <div class="drawer_order_content_box_title">基本信息</div>
                    <div class="drawer_order_content_box_content basic_info">
                        <div class="drawer_order_content_row basic_info_border"
                            :style="{ borderColor: drawer_basic_data.nameTrue == false ? 'red' : 'transparent', }">
                            <span>姓名</span>
                            <el-input v-model="drawer_basic_data.name" style="width: 150px" size="small"
                                placeholder="请输入姓名"></el-input>
                        </div>
                        <div class="drawer_order_content_row basic_info_border"
                            :style="{ borderColor: drawer_basic_data.phoneTrue == false ? 'red' : 'transparent', }">
                            <span>手机</span>
                            <el-input v-model="drawer_basic_data.phone" style="width: 150px" size="small"
                                placeholder="请输入手机号"></el-input>
                        </div>
                        <div class="drawer_order_content_row basic_info_border"
                            :style="{ borderColor: drawer_basic_data.channelTrue == false ? 'red' : 'transparent', }">
                            <span>渠道</span>
                            <div class="selected_channel">
                                <el-select v-model="drawer_basic_data.channel" size="small"
                                    style="width: 150px;height: 32px;">
                                    <el-option v-for=" item  in  channelOptions " :key="item.channel_id" :label="item.name"
                                        :value="item.channel_id">
                                        <div class="custom_select">
                                            <div :style="item.color"></div>
                                            <span>{{ item.name }}</span>
                                        </div>
                                    </el-option>
                                    <div slot="prefix">
                                        <div class="selected_channel_color" :style="selected_channel.color"></div>
                                    </div>
                                </el-select>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- 房间信息 -->
                <div class="drawer_order_content_box">
                    <div class="drawer_order_content_box_title room_title">
                        <span>房间信息</span>
                        <span>共{{ drawer_room_data.length }}间房</span>
                    </div>
                    <div class="drawer_order_content_box_content room_info">
                        <!-- 填写房间信息 -->
                        <div v-for="( item, index ) in drawer_room_data " :key="index">
                            <div class="drawer_order_content_row info_flex">
                                <div class="row_input" :style="{ borderColor: item.isTrue == false ? 'red' : '#DCDFE6', }">
                                    <!-- 日期选择器 -->
                                    <div class="row_input_date_picke">
                                        <el-date-picker v-show="select_room == 0" @change="room_info_Change(item)"
                                            v-model="item.date" size="small" style="width:125px;" :default-value="item.date"
                                            value-format="yyyy-MM-dd" format="MM-dd" type="date">
                                        </el-date-picker>

                                        <el-date-picker v-show="select_room == 1" v-model="item.date"
                                            format="MM-dd HH:mm:ss" type="datetime" style="width:125px;" size="small"
                                            default-time="00:00:00">
                                        </el-date-picker>
                                        <div class="row_input_date_picke_text">
                                            入住
                                            <i :class="select_room == 0 ? 'el-icon-date' : 'el-icon-time'"></i>
                                        </div>
                                    </div>
                                    <!-- 数量 -->
                                    <el-popover class="row_input_nums" placement="top-start" title="" width="150"
                                        trigger="click">
                                        <div>
                                            <el-input-number @change="room_info_Change(item)" v-model="item.days" :min="1"
                                                :max="select_room == 0 ? Infinity : 24" size="small"></el-input-number>
                                        </div>
                                        <div slot="reference">
                                            {{ item.days ? item.days : '--' }}{{ select_room == 0 ? '晚' : '小时' }}
                                        </div>
                                    </el-popover>
                                    <!-- 级联选择器 -->
                                    <div class="row_input_select">
                                        <div class="row_input_select">
                                            <el-cascader @change="room_info_Change(item)" filterable v-model="item.room_id"
                                                :options="select_room == 1 ? hoursOptions : roomOptions"
                                                :props="{ emitPath: false, checkStrictly: false, }" show-all-levels>
                                            </el-cascader>
                                        </div>
                                    </div>
                                    <!-- 价格 -->
                                    <div class="row_input_price">
                                        <el-input v-model="item.price" size="small">
                                            <span slot="prefix" style="color: black;">￥</span>
                                        </el-input>
                                    </div>
                                </div>
                                <!-- 填写入住人信息 -->
                                <div class="info_flex_center">
                                    <el-button type="text" @click="occupant(item, index)">入住人</el-button>
                                </div>
                                <!-- 删除 -->
                                <div>
                                    <el-button @click="deleteData(index, drawer_room_data, 'drawer_room_data')"
                                        :class="item.order_room_id ? '' : 'show_reminder_icon'" type="text"
                                        :disabled="item.is_has_order_room" size="mini">
                                        <i class="el-icon-delete"></i>
                                    </el-button>
                                </div>
                            </div>

                            <!-- 钟点房显示的时间 -->
                            <div style="font-size: 11px;margin-top: 5px;margin-left: 10px;" v-show="select_room == 1">
                                <span>
                                    {{ formatDate(new Date(item.date), 2) }}
                                    至
                                    {{ countHours(new Date(item.date), item.days) }}
                                </span>
                            </div>
                        </div>
                        <!-- 添加房间信息 -->
                        <div class="drawer_order_content_row">
                            <el-button size="small" plain class="addBtn" style="border: 1px solid #409EFF;padding:10px"
                                @click="addroom">
                                <i class="el-icon-plus"> 添加房间</i>
                            </el-button>
                        </div>
                    </div>
                </div>


                <!-- 消费信息 -->
                <div class="drawer_order_content_box">
                    <div class="drawer_order_content_box_title ">消费信息</div>
                    <div class="drawer_order_content_box_content">
                        <!-- 填写消费信息 -->
                        <div class="drawer_order_content_row info_flex" v-for="( item, index ) in  drawer_consumption_data "
                            :key="item.id">
                            <div class="row_input row_short_input"
                                :style="{ borderColor: item.isTrue == false ? 'red' : '#DCDFE6', }">
                                <!-- 日期选择器 -->
                                <div class="row_input_date_picke">
                                    <el-date-picker placeholder="选择日期" v-model="item.date" size="small"
                                        style="width:125px;border: none;" :default-value="item.date"
                                        value-format="yyyy-MM-dd" format="MM-dd" type=date>
                                    </el-date-picker>
                                    <div class="row_input_date_picke_text">
                                        <i class="el-icon-date"></i>
                                    </div>
                                </div>
                                <!-- 数量 -->
                                <el-popover class="row_input_nums" placement="top-start" title="" width="150"
                                    trigger="click">
                                    <div>
                                        <el-input-number @change="consum_info_Change(item)" v-model="item.num" :min="1"
                                            size="small"></el-input-number>
                                    </div>
                                    <div slot="reference"><span>{{ item.num ? item.num : '--' }}</span> 份</div>
                                </el-popover>
                                <!-- 选择器 -->
                                <div class="row_input_select">
                                    <el-select v-model="item.consum_item.id" placeholder="请选择消费项目"
                                        @change="consum_info_Change(item)">
                                        <el-option v-for="( items, consumindex ) in  consumeOptions "
                                            :key="`items.id+${items.id}+${consumindex}`" :label="items.name"
                                            :value="items.id" :disabled="!items.status">
                                        </el-option>
                                    </el-select>
                                </div>
                                <!-- 价格 -->
                                <div class="row_input_price">
                                    <el-input v-model="item.total_price" size="small">
                                        <span slot="prefix" style="color: black;">￥</span>
                                    </el-input>
                                </div>
                            </div>
                            <div class="info_flex_center">
                                <el-popover placement="top-start" title="" width="300" trigger="click">
                                    <div>
                                        <el-input type="textarea" resize="none" :autosize='{ minRows: 2 }'
                                            placeholder="备注信息" v-model="item.remarks" maxlength="2048" show-word-limit>
                                        </el-input>
                                    </div>
                                    <el-button slot="reference" type="text">备注</el-button>
                                </el-popover>
                            </div>
                            <!-- 删除 -->
                            <div @click="deleteData(index, drawer_consumption_data)">
                                <i class="el-icon-delete"></i>
                            </div>
                        </div>
                        <!-- 添加消费信息-->
                        <div class="drawer_order_content_row">
                            <el-button size="small" plain class="addBtn" @click="addConsume">
                                <i class="el-icon-plus"> 添加消费</i>
                            </el-button>
                        </div>

                    </div>
                </div>

                <!-- 收款信息 -->
                <div class="drawer_order_content_box" v-if="fill_order_title_show != 2">
                    <div class="drawer_order_content_box_title ">收款信息</div>
                    <div class="drawer_order_content_box_content">
                        <!-- 填写收款信息 -->
                        <div class="drawer_order_content_row info_flex" v-for="( item, index ) in  drawer_collection_data "
                            :key="item.id">
                            <div class="row_input row_short_input"
                                :style="{ borderColor: item.isTrue == false ? 'red' : '#DCDFE6', }">
                                <!-- 日期选择器 -->
                                <div class="row_input_date_picke">
                                    <el-date-picker placeholder="选择日期" v-model="item.date" size="small"
                                        style="width:125px;border: none;" :default-value="new Date()"
                                        value-format="yyyy-MM-dd" format="MM-dd" type=date>
                                    </el-date-picker>
                                    <div class="row_input_date_picke_text">
                                        <i class="el-icon-date"></i>
                                    </div>
                                </div>
                                <!-- 选择器 -->
                                <div class="row_input_select type_select">
                                    <!-- 请选择收款类型 -->
                                    <el-select v-model="item.type" placeholder="类型">
                                        <el-option v-for=" collect  in  collectOptions " :key="collect.value"
                                            :label="collect.label" :value="collect.value"></el-option>
                                    </el-select>
                                </div>
                                <div class="row_input_select pay_select">
                                    <!-- 请选择收款方式 -->
                                    <el-select v-model="item.pay_type" placeholder="收款方式">
                                        <el-option v-for="  payMethod  in  payMethodOptions " :key="payMethod.value"
                                            :label="payMethod.label" :value="payMethod.value"></el-option>
                                    </el-select>
                                </div>
                                <!-- 价格 -->
                                <div class="row_input_price">
                                    <el-input v-model="item.price" size="small">
                                        <span slot="prefix" style="color: black;">￥</span>
                                    </el-input>
                                </div>
                            </div>
                            <div class="info_flex_center">
                                <el-popover placement="top-start" title="" width="300" trigger="click">
                                    <div>
                                        <el-input type="textarea" resize="none" :autosize='{ minRows: 2 }'
                                            placeholder="备注信息" v-model="item.remarks" maxlength="2048" show-word-limit>
                                        </el-input>
                                    </div>
                                    <el-button slot="reference" type="text">备注</el-button>
                                </el-popover>
                            </div>
                            <!-- 删除 -->
                            <div @click="deleteData(index, drawer_collection_data)">
                                <i class="el-icon-delete"></i>
                            </div>
                        </div>
                        <!-- 添加收款信息-->
                        <div class="drawer_order_content_row">
                            <el-button plain size="small" class="addBtn" @click="addCollect">
                                <i class="el-icon-plus"> 添加收款</i>
                            </el-button>
                        </div>

                    </div>
                </div>


                <!-- 提醒信息 -->
                <div class="drawer_order_content_box">
                    <div class="drawer_order_content_box_title ">提醒信息</div>
                    <div class="drawer_order_content_box_content">
                        <!-- 填写提醒信息 -->
                        <div class="drawer_order_content_row info_flex" v-for="( item, index ) in  drawer_reminder_data "
                            :key="item.id">
                            <!-- 提醒信息显示 -->
                            <div class="show_reminder_info">
                                <div class="show_reminder_info_date">{{ item.reminder_time }}</div>
                                <div class="show_reminder_info_conten">{{ item.content }}</div>
                            </div>

                            <!-- 编辑 -->
                            <div>
                                <el-button @click="addReminder(item)" type="text" :disabled="item.is_remind == 1"
                                    size="mini"><i class="el-icon-edit"></i>
                                </el-button>
                            </div>
                            <!-- 删除 -->
                            <div>
                                <el-button @click="deleteData(index, drawer_reminder_data)" type="text"
                                    :disabled="item.is_remind == 1" size="mini" class="show_reminder_icon">
                                    <i class="el-icon-delete"></i>
                                </el-button>
                            </div>

                        </div>
                        <!-- 添加提醒信息-->
                        <div class="drawer_order_content_row">
                            <el-button plain size="small" class="addBtn" @click="addReminder()">
                                <i class="el-icon-plus"> 添加提醒</i>
                            </el-button>
                        </div>

                    </div>
                </div>

                <!-- 备注信息 -->
                <div class="drawer_order_content_notes">
                    <el-input type="textarea" resize="none" :autosize='{ minRows: 4 }' placeholder="备注信息" v-model="remarks"
                        maxlength="2048" show-word-limit>
                    </el-input>
                    <div class="drawer_order_content_notes_color">
                        <el-color-picker size="small" v-model="remarks_color" disabled></el-color-picker>
                        <span>订单特殊颜色</span>
                    </div>
                </div>

                <!-- 底部 -->
                <div class="drawer_order_bottom">
                    <div class="drawer_order_bottom_price">
                        <div v-show="fill_order_title_show == 1"> 订单金额：<span style=" color: #0486FE;">
                                ￥{{ orderPrice ? orderPrice : '0.00' }}</span></div>
                        <div v-show="fill_order_title_show == 2" class="drawer_order_bottom_price_detail">
                            订单金额：<span style=" color: #0486FE;">￥{{ order_detail_data.order_money }}</span>
                            <p>
                                已付: <span style="color: #E9AD55;">￥{{ order_detail_data.pay_money }}</span>
                                还需收款 : <span style="color: #F56C6C;">￥{{ order_detail_data.no_pay_money }}</span>
                            </p>
                        </div>
                    </div>
                    <div class="drawer_order_bottom_btn">
                        <el-button size="small" @click="cancell_order()">取消</el-button>
                        <!-- 填写订单 -->
                        <el-button type="primary" size="small" @click="submit_order(selectOperated == 2 ? 0 : 1)"
                            v-show="selectOperated == 2 || selectOperated == 3 && fill_order_title_show == 1">
                            {{ selectOperated == 2 ? '直接入住' : '补录订单' }}
                        </el-button>
                        <el-button type="primary" size="small" @click="submit_order(1)"
                            v-show="selectOperated == 2 || selectOperated == 1 && fill_order_title_show == 1">
                            提交订单
                        </el-button>

                        <!-- 修改订单 -->
                        <el-button type="primary" size="small" @click="submit_order(4)" v-show="fill_order_title_show == 2">
                            保存
                        </el-button>
                    </div>
                </div>

            </div>



            <!-- 内层嵌套的抽屉 -->
            <el-drawer destroyOnClose :append-to-body="true" class="inner_drawer" :visible.sync="innerDrawer" size="500px"
                :modal-append-to-body="false" :close-on-click-modal="false">
                <!-- 标题slot -->
                <div slot="title" class="titleSlot">
                    <div class="titleIcon" @click="back('innerDrawer')">
                        <i class="el-icon-back"></i>返回
                    </div>
                    <span>{{ innerDrawer_title }}</span>
                </div>
                <!-- 分界线 -->
                <div v-if="isShow_innerDrawer == 2" style=" border-top: 1px solid rgb(190, 189, 189);margin-top:15px"></div>

                <!-- 入住人-->
                <div v-show="isShow_innerDrawer == 1">
                    <!-- 入住房间信息 -->
                    <div class="checkIn_room">
                        <div>
                            入住时间：<span>{{ selected_checkIn_person_data.date ? selected_checkIn_person_data.date.substring(5)
                                : '--'
                            }}</span>
                        </div>
                        <div><span>{{ selected_checkIn_person_data.date ? selected_checkIn_person_data.days : '--'
                        }}</span>晚</div>
                        <div>
                            <span>{{ selected_checkIn_person_data.date ? selected_checkIn_person_data.room[0] : '--'
                            }}</span> /
                            <span>{{ selected_checkIn_person_data.date ? selected_checkIn_person_data.room[1] : '--'
                            }}</span>
                        </div>
                        <div>￥<span>{{ selected_checkIn_person_data.date ? selected_checkIn_person_data.price : '--'
                        }}</span></div>
                    </div>
                    <!-- 入住人信息 -->
                    <div class="checkIn_person">
                        <div class="checkIn_person_title">入住人姓名为必填项</div>
                        <!-- 填写入住人信息 -->
                        <div class="checkIn_person_info" v-for="( item, index ) in  checkIn_person_list " :key="item.id"
                            :style="{ borderColor: item.isTrue == false ? 'red' : 'transparent', }">
                            <div class="checkIn_person_info_input">
                                <div><el-input v-model="item.name" placeholder="客人姓名" size="small"
                                        style="width: 75px; "></el-input>
                                </div>
                                <div><el-input v-model="item.phone" placeholder="手机号码" size="small"
                                        style="width: 101px;"></el-input>
                                </div>
                                <div>
                                    <el-select v-model="item.card_type" placeholder="请选择" style="width: 89px;">
                                        <el-option v-for=" items  in  id_type_options " :key="items.id" :label="items.label"
                                            :value="items.value">
                                        </el-option>
                                    </el-select>
                                </div>
                                <div><el-input v-model="item.card_no" placeholder="证件号" size="small"
                                        style="width: 155px;"></el-input>
                                </div>
                            </div>
                            <!-- 删除 -->
                            <div class="checkIn_person_info_delete" @click="deleteData(index, checkIn_person_list)">
                                <i class="el-icon-delete"></i>
                            </div>
                        </div>

                        <!-- 添加入住人 -->
                        <div class="checkIn_person_info_add">
                            <el-button size="small" @click="addOccupant" plain class="addBtn">
                                <i class="el-icon-plus"> 添加入住人</i>
                            </el-button>
                        </div>
                    </div>
                </div>
                <!-- 添加提醒 -->
                <div v-show="isShow_innerDrawer == 2" class="remind_form">
                    <div class="remind_form_content">
                        <el-form label-position="left" ref="remindForm" :rules="remind_rules" :model="selected_remind_data"
                            label-width="80px">
                            <el-form-item label="活动名称" prop="reminder_time">
                                <el-date-picker v-model="selected_remind_data.reminder_time" format="yyyy-MM-dd HH:mm:ss"
                                    type="datetime" placeholder="选择日期时间" value-format="yyyy-MM-dd HH:mm:ss">
                                </el-date-picker>
                            </el-form-item>
                            <el-form-item label="提醒内容" prop="content">
                                <el-input type="textarea" v-model="selected_remind_data.content" :autosize='{ minRows: 5 }'
                                    placeholder="备注信息" maxlength="200" resize="none" show-word-limit></el-input>
                            </el-form-item>
                        </el-form>
                    </div>
                </div>
                <!-- 内层嵌套底部 -->
                <div class="inner_drawer_order_bottom">
                    <div class="drawer_order_bottom_price"></div>
                    <div class="inner_drawer_order_bottom_btn">
                        <el-button size="small" @click="cancell_innerDrawer">取消</el-button>
                        <el-button type="primary" size="small" v-show="isShow_innerDrawer == 1"
                            @click="subOccupant(drawer_room_data, 'drawer_room_data')">确认</el-button>
                        <!-- 提醒内容提交 -->
                        <el-button type="primary" size="small" v-show="isShow_innerDrawer == 2"
                            @click="submitForm('remindForm', 'add')">确认</el-button>
                    </div>
                </div>

            </el-drawer>



        </el-drawer>
    </div>
</template>
   


<script>
import { cloneDeep } from 'lodash'
import { generateRandomID } from "../../../api/getRandom"//获取随机id

export default {
    props: {
        fillData: {
            type: Object,
            required: true,
        },
    },
    components: {
        // Price
    },
    computed: {
        orderPrice() {
            let price = 0;
            this.drawer_room_data.forEach(item => {//计算房间的
                item.price = item.price && item.price.replace(/,/g, '')
                if (isNaN(item.price)) {// item.price 不是数字
                    console.log(item.price);
                    item.price = 0
                }
                price += parseFloat(item.price)
            });
            this.drawer_consumption_data.forEach(item => {
                item.total_price = item.total_price && item.total_price.replace(/,/g, '')
                if (isNaN(item.total_price)) { // item.total_price 不是数字
                    item.total_price = 0
                }
                price += parseFloat(item.total_price)
            })
            // price = (price).toFixed(2
            return price;
        },
    },
    watch: {
        fillData: {
            deep: true,
            handler(newValue) {
                this.name = newValue.name

                if (newValue.name == 'order') {
                    if (newValue.orderData != this.order_detail_data) {//订单详情的数据
                        this.order_detail_data = newValue.orderData
                        this.changeFillDrawer()
                        // console.log(newValue.orderData, '父组件传递了值订单详情数据发生改变');
                    }
                    console.log(newValue, 'fillData');
                } else if (newValue.name == 'today') {
                    this.drawer_room_data = newValue.drawer_room_data
                    this.selectOperated = newValue.selectOperated
                    this.fill_order_title_show = newValue.fill_order_title_show

                    if (this.fill_order_title_show == 2 && newValue.orderData && newValue.orderData != this.order_detail_data) {//订单详情的数据
                        this.order_detail_data = newValue.orderData
                        this.changeFillDrawer()
                    }
                }
            },
        },
        'drawer_basic_data.channel'(newVal) {
            this.channelOptions.forEach(item => {
                if (item.channel_id == newVal) {
                    this.selected_channel = item
                    this.selected_channel.color = item.color
                }
            })
        },
        deep: true // 开启深度监听
    },
    data() {
        return {
            hotel_id: sessionStorage.getItem('hotel_id'),
            // order_id:null,

            isShow_drawer: false,//外层
            innerDrawer: false,//内层
            fill_order_title: '修改订单',//外层填写订单标题
            fill_order_title_show: 1,//1填写订单。 2修改订单
            select_room: 0,//当前填写的房型信息 0全日房 1钟点房
            innerDrawer_title: '入住人信息',
            isShow_innerDrawer: 1,
            selectOperated: 1,//判断当前操作，1预订 2入住,3补录订单
            status: 6,//直接入住=>7,预订默认=>6

            checkIn_person_list: [{
                name: null,
                phone: null,
                card_type: 0,
                card_no: null,
                isTrue: true,
            }],// 填写入住人的数据

            channelOptions: [{
                channel_id: 1,
                name: '本地',
                color: 'background-color:#0f8ad8',
            },
            {
                channel_id: 2,
                name: '携程',
                color: 'background-color:#A69340',
            },
            {
                channel_id: 3,
                name: '途家',
                color: 'background-color:#FD8137',
            },
            {
                channel_id: 4,
                name: 'Booking',
                color: 'background-color:#333333',
            },
            {
                channel_id: 5,
                name: '小红书',
                color: 'background-color:#f40a0b',
            },],//渠道选择器
            consumeOptions: [],//消费项目选择器
            collectOptions: [{
                value: 3,
                label: "收款"
            },
            {
                value: 5,
                label: "收押金"
            }],//收款渠道选择器

            payMethodOptions: [
                {
                    label: '收款码',
                    value: 1,
                },
                {
                    label: '扫码付',
                    value: 2,
                },
                {
                    label: '飞猪代收',
                    value: 3,
                },
                {
                    label: '美团酒店代收',
                    value: 4,
                },
                {
                    label: '美团民俗代收',
                    value: 5,
                }, {
                    label: '现金',
                    valie: 6
                }],//收款方式选择器
            id_type_options: [
                {
                    id: 1,
                    label: '未知',
                    value: 99
                },
                {
                    id: 2,
                    label: '身份证',
                    value: 0
                }, {
                    id: 3,
                    label: '护照',
                    value: 1
                }, {
                    id: 4,
                    label: '港澳通行证',
                    value: 2
                }, {
                    id: 5,
                    label: '台湾通行证',
                    value: 3
                },
                {
                    id: 6,
                    label: '回乡证',
                    value: 4
                },
                {
                    id: 7,
                    label: '台胞证',
                    value: 5
                },
                {
                    id: 8,
                    label: '士兵证',
                    value: 6
                }, {
                    id: 9,
                    label: '军官证',
                    value: 7
                },
                {
                    id: 10,
                    label: '其他',
                    value: 99
                },
            ],//联系人证件类型

            roomOptions: [],//房间信息中房间选择器（需要改成每个房间都是独立的数据
            hoursOptions: [],

            selected_channel: {},//当前选中的渠道--基本信息
            selected_remind_data: {
                reminder_time: new Date(),
                content: '',
                id: null,
            },//当前显示的添加提醒数据
            selected_checkIn_person_data: {},//当前显示的添加入住人数据
            selsect_item_index: null,//当前显示的添加入住人数据的下标

            order_detail_data: {
                "order_no": "",
                "order_id": null,
                "is_hour_room": null,
                "channel": "",
                "user": {
                    "name": "",
                    "phone": ""
                },
                "rooms": [],
                "room_price": "",
                "order_money": 0,
                "pay_money": 0,
                "no_pay_money": 0,
                "consume_price": null,
                "consume_list": [],
                "reminder": [],
                "pay_list": [],
                "remarks": ""
            },//当前订单详情信息数据

            remind_rules: {
                reminder_time: [{ required: true, message: '请选择提醒时间', trigger: 'blur' }],
                content: [{ required: true, message: '请选择输入备注信息', trigger: 'blur' }],
            },//添加提醒入住的表单规则

            /**
            * 提交订单需要用到的数据
            */
            drawer_basic_data: {
                name: null,
                phone: null,
                channel: 1,
                nameTrue: true,
                phoneTrue: true,
                channelTrue: true,
            },//基础信息数据
            drawer_room_data: [],//房间信息数据
            drawer_consumption_data: [],//消费信息数据      
            drawer_collection_data: [],//收款信息数据
            drawer_reminder_data: [],//提醒信息数据
            remarks: null,//备注信息
            remarks_color: null,//订单特殊颜色



            /* +++++++++++++++需要父组件传递的数据+++++++++++++++++++++++++++++*/
            name: null,//用于判断是什么页面点击 calendar日历房态 today单日房态 order订单

            /* +++++++++++++++传递给组件price的值+++++++++++++++++++++++++++++*/
            orderPriceData: {},

        }
    },
    created() {
        this.selected_channel.color = 'background-color:#0f8ad8'//选中渠道颜色--填写订单
        this.getAllRoom().then(res => {
            this.roomOptions = res
            // console.log(this.getAllRoom());
        })
        this.getConsumeList()
    },
    methods: {

        // 修改数据保存成功之后关闭页面，并且传递自定义事件，告诉父组件保存成功，订单详情组件再次请求订单详情数据 


        /**
         * 修改页面数据转换
         */
        changeFillDrawer() {
            console.log('修改数据---订单详情数据发生改变');
            this.drawer_room_data = []
            this.drawer_consumption_data = []
            this.drawer_reminder_data = []

            // 获取选中渠道
            let channel_id = null
            this.channelOptions.forEach(element => {
                if (element.name == this.order_detail_data.channel) {
                    channel_id = element.channel_id
                    this.selected_channel = element
                }
            })
            // 基本信息
            this.drawer_basic_data.name = this.order_detail_data.user.name
            this.drawer_basic_data.phone = this.order_detail_data.user.phone
            this.drawer_basic_data.channel = channel_id
            // 房间信息
            this.order_detail_data.rooms.forEach(room => {
                // console.log(room.id,'drawer_room_data');
                this.drawer_room_data.push({
                    days: parseInt(room.date.substring(room.date.indexOf("，") + 1, room.date.indexOf("晚"))),
                    date: room.date.split("至")[0],
                    room_id: room.room_num_id,
                    price: room.price,
                    isTrue: true,
                    people: room.people,
                    order_room_id: room.id,
                    is_has_order_room: true
                })
            });

            console.log(this.order_detail_data.rooms, 'this.order_detail_data.rooms');
            console.log(this.drawer_room_data, ' this.drawer_room_data');


            // 消费信息
            let consume_option = {}
            this.order_detail_data.consume_list.forEach(consume => {
                consume_option = {
                    id: generateRandomID(),//消费项目id
                    name: consume.title,
                    price: consume.price.substring(1),//消费项目价格
                    status: false,//消费项目是否启动
                    type_id: null,
                }
                this.consumeOptions.push(consume_option)
                this.drawer_consumption_data.push({
                    date: consume.date,
                    remarks: consume.remarks,
                    total_price: consume.price.substring(1),
                    remarks: consume.remarks,
                    title: consume.title,
                    num: 1,
                    consum_item: consume_option
                })
            })
            this.order_detail_data.reminder.forEach(reminder => {
                this.drawer_reminder_data.push({
                    reminder_time: reminder.date,
                    content: reminder.content,
                    id: reminder.id,
                    is_remind: reminder.is_remind
                })
            })
            // 备注信息
            this.remarks = this.order_detail_data.remarks

            this.fill_order_title = '修改订单'
            this.fill_order_title_show = 2
            this.isShow_drawer = true
        },

        /**
        * 外层提交订单
        * @param {*} num 判断时入住还是预订 0直接入住 1预定 4修改订单保存
        * 
        */
        submit_order(num) {
            //验证信息
            if (this.order_verify() == false) {
                return
            }

            if (num == 0) {
                this.status = 7//直接入住
            } else if (num == 1) {
                this.status = 6//预订
            }

            let room_info = []
            let consume_info = []
            let pay_info = []
            let reminder = []


            this.drawer_room_data.forEach(item => {
                // console.log(item,'item.drawer_room_data');
                if (num == 4) {
                    room_info.push({
                        room_num_id: item.room_id,
                        start_date: this.select_room == 0 ? item.date : this.formatDate(new Date(item.date), 1),
                        price: item.price,
                        day: item.days,
                        people: item.people,
                        id: item.order_room_id ? item.order_room_id : 0
                    })
                } else if (num == 0 || num == 1) {
                    room_info.push({
                        room_num_id: item.room_id,
                        start_date: this.select_room == 0 ? item.date : this.formatDate(new Date(item.date), 1),
                        price: item.price,
                        day: item.days,
                        people: item.people,
                    })
                }

            })
            // console.log(this.drawer_room_data, ' this.drawer_room_data');
            this.drawer_consumption_data.forEach(item => {
                consume_info.push({
                    date: item.date,
                    price: item.total_price,
                    num: item.num,
                    remarks: item.remarks,
                    name: item.consum_item.name
                })
            })
            this.drawer_collection_data.forEach(item => {
                pay_info.push({
                    date: item.date,
                    remarks: item.remarks,
                    price: item.price,
                    type: item.type,
                    pay_type: item.pay_type
                })
            })
            this.drawer_reminder_data.forEach((item, index) => {
                reminder.push({
                    reminder_time: item.reminder_time,
                    content: item.content
                })
            })

            // 调用接口
            // 提交订单
            if (num == 0 || num == 1) {
                let data = {
                    hotel_id: this.hotel_id,//民宿/酒店id
                    status: this.status,//预订6、入住7
                    name: this.drawer_basic_data.name,//客户姓名
                    phone: this.drawer_basic_data.phone,//客户手机号
                    channel_id: this.drawer_basic_data.channel,//来源渠道id
                    room_info: room_info,//房间信息
                    consume_info: consume_info,//消费信息
                    pay_info: pay_info,//付款信息
                    reminder: reminder,//订单提醒
                    remarks: this.remarks,//备注
                    is_hour_room: this.select_room,//是否是钟点房 1 钟点房 0 全日房
                }
                console.log(data, '提交的订单数据、预订和入住');
                this.my_request('supplier/hotel-pms-order', data, 'POST').then(res => {
                    console.log(res, 'res');
                    let { code, data, message } = res.data
                    if (200 == code) {
                        this.$message.success(message);
                        if (this.name == 'calendar') {
                            this.getRoomChannels()
                        }
                        else if (this.name == 'today') {
                            console.log(this.name);
                            this.$emit('check_roomApartment', 'successSubmit')
                        }
                        // 清空数据
                        this.drawer_room_data = []
                        this.drawer_consumption_data = []
                        this.drawer_collection_data = []
                        this.drawer_reminder_data = []

                        this.drawer_basic_data.name = null
                        this.drawer_basic_data.phone = null
                        this.drawer_basic_data.channel = 1
                        this.select_room = 0
                        this.remarks = null

                        // this.operation_room_arr = []
                    } else {
                        this.$message.warning(message);
                    }
                })
            }

            // 修改订单的保存订单
            else if (4 == num) {
                console.log('保存订单');
                let edit_order_data = {
                    order_id: this.order_detail_data.order_id,
                    name: this.drawer_basic_data.name,//客户姓名
                    phone: this.drawer_basic_data.phone,//客户手机号
                    channel_id: this.drawer_basic_data.channel,//来源渠道id
                    room_info: room_info,//房间信息
                    consume_info: consume_info,//消费信息
                    remarks: this.remarks,//备注
                }
                console.log(edit_order_data, '修改了订单的数据');
                this.my_request('supplier/hotel-pms-order', edit_order_data, 'PUT').then(res => {
                    console.log(res, '保存订单');
                    let { code, message } = res.data
                    if (200 == code) {
                        this.$message.success(message)
                        let detailDate = {}
                        this.get_order_detail()
                            .then(res => {
                                detailDate = res
                                console.log(detailDate, '修改了成功');
                                this.$emit('success_edit', this.order_detail_data)
                                this.$emit('editSuccess')

                            })

                    } else {
                        this.$message.error('修改失败')
                    }
                })
                // 保存订单
            }
        },
        // 获取订单详情
        get_order_detail() {
            let data = {
                order_id: this.order_detail_data.order_id
            }
            // console.log(data, '获取订单详情');
            return this.my_request('supplier/hotel-pms-order/show', data, 'GET').then(res => {
                let { code, data } = res.data
                if (200 == code) {
                    this.order_detail_data = data
                    console.log(data, '修页面获取订单详情');
                }
                return data
            })
        },
        /**
         * 内层添加提醒表单----确认添加提醒
         * @param {*} formName 表单名称
         * @param {*} operate 操作
         */
        submitForm(formName, operate) {
            this.$refs[formName].validate((valid) => {
                if (valid) {//表单信息正确时，则 添加到/编辑 数组，并且返回上一级抽屉
                    // console.log(this.selected_remind_data, 'selected_remind_data');
                    // 添加/编辑 提醒
                    /**
                     * 订单详情调用接口
                     * 填写订单不调用
                     */
                    if (this.selected_remind_data.id) {//有id是编辑
                        this.drawer_reminder_data.forEach(element => {
                            if (element.id == this.selected_remind_data.id) {
                                element.content = this.selected_remind_data.content
                                element.reminder_time = this.selected_remind_data.reminder_time
                            }
                            this.innerDrawer = false
                        });
                    } else {//无id是添加
                        // console.log('无id是添加,填写订单');
                        this.drawer_reminder_data.push({
                            id: generateRandomID(),
                            reminder_time: this.selected_remind_data.reminder_time,
                            content: this.selected_remind_data.content
                        })
                        this.innerDrawer = false
                        return
                    }
                } else {
                    return false;
                }
            });
        },

        // 取消
        cancell_order() {
            this.isShow_drawer_detail = true
            console.log('取消');
        },
        /**
         *内层取消按钮
         */
        cancell_innerDrawer() {
            this.checkIn_person_list = [{
                name: null,
                phone: null,
                card_type: 0,
                card_no: null
            }]
            this.innerDrawer = false
        },


        // 订单数据验证
        order_verify() {
            let verify = true
            let isPass_basic = false
            let isPass_room = false
            let isPass_consume = false
            let isPass_pay = false
            //  基本信息部分
            for (const key in this.drawer_basic_data) {
                if (key.indexOf('True') == -1) {
                    if (this.drawer_basic_data[key]) {
                        this.drawer_basic_data[`${key}True`] = true
                    } else {
                        this.drawer_basic_data[`${key}True`] = false
                        this.$message.warning('请完整填写基本信息!');
                        isPass_basic = true
                        return verify = false
                    }
                }
            }
            if (isPass_basic) {
                return verify = false
            }


            // 房间信息部分
            this.drawer_room_data.forEach(item => {
                if (item.room_id) {
                    item.isTrue = true
                } else {
                    item.isTrue = false
                    this.$message.warning('请选择房间!');
                    isPass_room = true
                }
            })
            if (isPass_room) {
                console.log('isPass_room');
                return verify = false

            }
            // 消费信息部分
            this.drawer_consumption_data.forEach(item => {
                if (item.consum_item.id && item.consum_item.price) {
                    item.isTrue = true
                } else {
                    item.isTrue = false
                    isPass_consume = true
                    if (item.consum_item.id && !item.consum_item.price) {
                        this.$message.warning('请填写金额!');
                    } else {
                        this.$message.warning('请完整填写消费信息!');
                    }
                }
            })
            if (isPass_consume) {
                return verify = false

            }
            // 收款信息部分
            this.drawer_collection_data.forEach(item => {
                if (item.type && item.pay_type && item.price) {
                    item.isTrue = true
                } else {
                    item.isTrue = false
                    isPass_pay = true
                    if (item.type && item.pay_type && !item.price) {
                        this.$message.warning('请填写金额!');
                    } else {
                        this.$message.warning('请完整填写收款信息!');
                    }
                }
            })
            if (isPass_pay) {
                return verify = false

            }
            return verify
        },


        /**
        * 添加房间
        */
        addroom() {
            if (this.select_room == 0) {
                this.getAllRoom().then(res => {
                    this.drawer_room_data.push({
                        date: this.formatDate(new Date()),//入住日期
                        days: 1,//入住天数
                        room_id: null,//房间id
                        price: 0,
                        people: [],
                        isTrue: true,
                        room_options: res
                    })
                })
                console.log(this.drawer_room_data, 'drawer_room_data');
            } else {
                this.getAllRoom().then(res => {
                    this.drawer_room_data.push({
                        id: this.drawer_room_data.length + 1,
                        date: this.setTime(new Date()),//入住日期
                        days: 4,//入住小时
                        room_id: null,//房间id
                        price: 0,
                        people: [],
                        isTrue: true,
                        room_options: res
                    })
                })
                console.log(this.drawer_room_data, 'drawer_room_data');
            }
        },
        /**
         * 选中房间信息发生变化触发
         * 重新获取房间价格
         * @param {*} room 当前房间信息发生变化的数据
         * 
         */
        async room_info_Change(room) {
            let num = room && this.getHouseId(room.room_id) ? this.getHouseId(room.room_id) : null
            let room_date = {
                room_id: num,
                start_date: room.date,
                day: room.days,
            }
            console.log(room, '选中房间信息发生变化触发');
            // 获取全日房价格
            if (room_date.room_id && room_date.start_date && room_date.day && this.select_room == 0) {//全日房
                await this.getAppointRoomPrice(room_date).then(res => {
                    console.log(res, '全日房');
                    room.price = res
                })
            }
            // 获取钟点房价格
            else if (room_date.room_id && room_date.start_date && room_date.day && this.select_room == 1) {//钟点房
                let room_date_hours = {
                    room_id: this.getHouseId(room.room_id),
                }
                await this.my_request('supplier/hotel-pms-order/hour-room', room_date_hours, 'GET').then(res => {
                    console.log(res.data.data[0].price, '钟点房');
                    let { code, data } = res.data
                    if (200 == code) {
                        room.price = data[0].price
                        console.log(data, 'room_date_hours');
                    }
                })
            }
        },
        //获取指定房间日期的价格
        getAppointRoomPrice(data) {
            let book_price = null
            return this.my_request('supplier/hotel-pms/book-price', data, 'GET').then(res => {
                let { code, data } = res.data
                if (200 == code) {
                    book_price = data.book_price
                    // console.log(book_price, '获取指定房间日期的价格');
                    return book_price
                }
            })

        },
        // 获取选中日期当日的所有房间
        getAllRoom(getallroom) {
            let roomdata = []

            let allRoom = {//如果沒有传数据，则使用默认的
                hotel_id: this.hotel_id,
                is_hour_room: this.select_room == 0 ? 0 : 1,//0全日房 1 钟点房
                date: this.formatDate(new Date())//入住日期 
            }
            if (getallroom) {//传了数据使用数据
                allRoom = getallroom
            }

            // console.log(allRoom, '获取选中日期当日的所有房间');
            return this.my_request('supplier/hotel-pms-order/room-num', allRoom, 'GET').then(res => {
                let { code, data } = res.data
                // console.log(res,'获取所有房间');
                if (200 == code) {
                    roomdata = data.map((item) => ({
                        value: item.id,
                        label: item.pms_title,
                        children: item.room_num_list.map((room) => {
                            room.is_use = room.is_use == 0 ? false : true //0表示未占用，可以选择=false(不禁用)
                            return ({
                                value: room.id,
                                label: room.room_num,
                                disabled: room.is_use
                            })
                        })
                    }))
                    return roomdata
                }
            })
        },

        /**
        *入住人
        * @param {*} item 当前点击的入住人行--房间信息和入住人信息
        */
        occupant(item, index) {
            this.selected_checkIn_person_data.date = item.date
            this.selected_checkIn_person_data.days = item.days
            this.selected_checkIn_person_data.price = item.price
            this.selected_checkIn_person_data.room = this.getHouseId(item.room_id, true)
            if (item.people.length > 0) {
                this.checkIn_person_list = item.people
            } else {
                this.checkIn_person_list = [
                    {
                        name: null,
                        phone: null,
                        card_type: 0,
                        card_no: null,
                        isTrue: true,
                    }
                ]
            }
            this.selsect_item_index = index//当前操作的入住人信息的下标
            this.innerDrawer_title = '入住人信息'
            this.isShow_innerDrawer = 1
            this.innerDrawer = true
        },
        /**
         *添加入住人
         */
        addOccupant() {
            this.checkIn_person_list.push({
                name: null,
                phone: null,
                card_no: null,
                card_type: 0,
                isTrue: true,//用于判断是否填写姓名，加边框
            })
        },
        /**
         * 确认添加入住人
         * @param {*} data 修改的入住人信息的房间数据
         * @param {*} name 操作的抽屉
         */
        subOccupant(data, name) {
            let hasEmptyName = false;//检查是否有未填写姓名的数据
            this.checkIn_person_list.forEach(person => {
                if (!person.name) {
                    person.isTrue = false
                    hasEmptyName = true;
                } else {
                    person.isTrue = true
                }
            })

            if (hasEmptyName) {
                this.$message.warning('请填写入住人姓名!');
                return
            }
            data[this.selsect_item_index].people = cloneDeep(this.checkIn_person_list)

            this.innerDrawer = false
            this.checkIn_person_list = [{
                name: null,
                phone: null,
                card_type: 0,
                card_no: null,
                isTrue: true,
            }]
        },
        /**
         * 添加消费
         */
        addConsume() {
            this.drawer_consumption_data.push({
                consum_item: {
                    id: null,//消费项目id
                    name: null,
                    price: 0,//消费项目价格
                    status: null,//消费项目是否启动
                    type_id: null,
                },//消费项目信息
                date: this.formatDate(new Date()),//消费日期
                num: 1,//消费项目数量
                remarks: null,//备注
                total_price: 0,//总价格
                isTrue: true
            })
            // console.log(this.drawer_consumption_data, 'drawer_consumption_data');
        },
        /**
         * 
         * @param {*} consum 当前选中消费项目发生变化的数据
         * @param {*} name 改变的数据名
         */
        consum_info_Change(consum) {
            this.consumeOptions.forEach(item => {
                if (item.id == consum.consum_item.id) {
                    consum.consum_item = item
                    consum.total_price = (parseFloat(consum.consum_item.price) * consum.num).toFixed(2)
                }
            })
        },
        //获取消费项列表--填写订单内的消费信息
        getConsumeList() {
            this.consumeOptions = []
            let consume_data = {
                hotel_id: this.hotel_id
            }
            this.my_request('supplier/hotel-pms-consume', consume_data, 'GET').then(res => {
                let { code, data } = res.data
                if (200 == code) {
                    this.consumeOptions = data.list
                }
                // console.log(this.consumeOptions, '获取消费项目');
            })
        },

        /**
         * 添加收款
         */
        addCollect() {
            this.drawer_collection_data.push(
                {
                    id: this.drawer_collection_data.length + 1,
                    price: 0,
                    type: 3,//3收款，5收押金
                    pay_type: null,
                    date: this.formatDate(new Date()),//入住日期
                    remarks: null,//备注
                    isTrue: true
                },
            )
            console.log(this.drawer_collection_data, 'drawer_collection_data');
        },

        /**
         * 添加/编辑提醒
         * @param {obj} item 获取到的当前的提醒信息 有item代表是t修改，没有则是添加
         * @param {obj} item 获取到的当前的提醒信息 有item代表是t修改，没有则是添加
         */

        addReminder(item) {
            // console.log(operate, 'addReminder');
            if (item) {
                this.innerDrawer_title = '修改提醒'
                console.log(item.id, 'edit', this.selected_remind_data);
                this.selected_remind_data.reminder_time = item.reminder_time ? item.reminder_time : item.date
                this.selected_remind_data.content = item.content
                this.selected_remind_data.id = item.id//编辑则添加id
            } else {
                this.innerDrawer_title = '添加提醒'
                console.log('add', this.selected_remind_data);
                this.selected_remind_data.reminder_time = this.formatDate(new Date(), 1)
                this.selected_remind_data.content = null
                this.selected_remind_data.id = null//添加没有id
            }
            this.isShow_innerDrawer = 2
            this.innerDrawer = true
        },

        //切换房型  0全日房，1钟点房
        change_select_room() {
            // this.drawer_room_data = []

            let arr = []
            if (this.select_room == 0) {
                if (this.name = 'today') {
                    this.$emit('check_roomApartment')
                }
                this.select_room = 1
                this.getAllRoom().then(res => {
                    this.hoursOptions = res
                    arr = [{
                        date: this.setTime(new Date()),//入住日期
                        days: 4,//入住小时
                        room_id: null,//房间id
                        price: 0,
                        people: [],
                        isTrue: true,
                    }]
                    console.log(res, '钟点房型');
                    this.drawer_room_data = arr
                })
            } else {
                this.select_room = 0
                this.drawer_room_data = [{
                    date: this.formatDate(new Date()),//入住日期
                    days: 1,//入住天数
                    room_id: null,//房间id
                    price: 0,//房间j价格
                    people: [],
                    isTrue: true,
                }]
            }
        },

        /**
        * 删除方法====公共
        * @param {*} index 删除的数据下标
        * @param {*} data 删除的数据所在数组
        * @param {*} name 数组名
        */
        deleteData(index, data, name) {
            if (name == 'drawer_room_data') {//房间信息必须有一条数据
                if (data.length == 1) {
                    this.$message.warning('必须保留一个房间信息！');
                    return
                }
            }
            data = data.splice(index, 1)
        },
        /**
        * back 返回
        */
        back(drawer) {
            console.log("点击了返回");
            // if (this.fill_order_title_show == 2 || this.innerDrawer == false || this.isShow_drawer == true) {
            //     this.isShow_drawer = false
            //     return
            // }
            this.innerDrawer = false
            // this.drawer = false
            console.log(drawer);
        },






        /**
        * 根据房间id获取房型id
        * @param {*} id 房间id
        * @param {*} bool true--获取房间和房型名
        */
        getHouseId(id, bool) {
            let house_id = null
            let house_name = []
            this.roomOptions.forEach(item => {
                item.children.forEach(items => {
                    if (items.value == id) {
                        house_id = item.value
                        house_name[0] = items.label
                        house_name[1] = item.label
                        return
                    }
                })
            })
            if (bool) {
                return house_name
            } else {
                return house_id
            }
        },


        /**
        * 转换成字符串格式
        * @param {*} date 
        * @param {*} key true返回MM-dd
        */
        formatDate(date, key) {
            let year = date.getFullYear();
            let month = String(date.getMonth() + 1).padStart(2, '0');
            let day = String(date.getDate()).padStart(2, '0');
            let hours = String(date.getHours()).padStart(2, '0');
            let minutes = String(date.getMinutes()).padStart(2, '0');
            let seconds = String(date.getSeconds()).padStart(2, '0');

            if (key == 1) {
                return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
            } else if (key == 2) {
                return `${month}-${day} ${hours}:${minutes}`;
            } else {
                return `${year}-${month}-${day}`;
            }
        },
        /**
         * 返回当前事件num小时后的时间
         * @param {*} date 当前时间
         * @param {*} num 定义要加的小时数
         */
        countHours(date, num) {
            date = new Date(date);

            // 加上 num 个小时
            date.setHours(date.getHours() + num);

            // 格式化日期为 "mm-dd HH-mm" 的字符串
            let formatted_date = `${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')} ${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`;

            // console.log(formatted_date); // 输出结果：08-07 12-00
            return formatted_date
        },
        setTime(date) {
            // 设置小时、分钟和秒钟为0
            const currentDate = new Date(date);
            currentDate.setHours(0);
            currentDate.setMinutes(0);
            currentDate.setSeconds(0);
            currentDate.setMilliseconds(0);
            return currentDate
        }
    },

}

</script>















<style lang="scss" scoped src="../order.scss"></style>